package daoImp;

import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.ArrayList;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import entity.sales;
import utils.ConnectionUtils;

public class CreatingSales extends HttpServlet {
	@Override
	protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		req.setCharacterEncoding("utf-8");
		resp.setContentType("text/html;charset=utf-8");
		PrintWriter pw=resp.getWriter();
		int sid=Integer.parseInt(req.getParameter("sid"));
		String ssource=req.getParameter("ssource");
		String cname=req.getParameter("cname");
		double success=Double.parseDouble( req.getParameter("success"));
		String sgeneral=req.getParameter("sgeneral");
		String sdescribe=req.getParameter("sdescribe");
		String founder=req.getParameter("founder");
		String stime=req.getParameter("stime");
		String sstate=req.getParameter("satate");
		String supid=req.getParameter("supid");
		String mgname=req.getParameter("mgname");
		String sgtime=req.getParameter("sgtime");
		sales s=new sales();
		s.setSid(sid);
		s.setCname(cname);
		s.setSsource(ssource);
		s.setSuccess(success);
		s.setSgeneral(sgeneral);
		s.setSdescribe(sdescribe);
		s.setFounder(founder);
		s.setStime(stime);
		s.setSstate(sstate);
		s.setMgname(mgname);
		s.setSgtime(sgtime);
		/*try {
			add(s);
		} catch (SQLException e) {
			e.printStackTrace();
		}*/
	}
	
}
